<template>
  <div class="app-container">
    <wise-crud ref="wise-crud" :urls="urls" :fields="fields" :handle="handle"  @selection-change="handleSelectionChange" :filters="filters">
      <!--      <template v-slot:handle="slotProps">-->
      <!--        <el-button v-if="slotProps.row.showStates === 0" type="primary" size="small" round @click.native.prevent="startHandle(slotProps.row)">大屏展示</el-button>-->
      <!--        <el-button v-if="slotProps.row.showStates === 1" type="primary" size="small" round @click.native.prevent="finishHandle(slotProps.row)">取消展示</el-button>-->
      <!--      </template>-->
      <template slot="outHandle">
        <!-- <el-col :span="3">
          <el-button type="primary" @click="handleAdd()"><i class="el-icon-plus" />报警设置</el-button>
        </el-col> -->
        <!-- <el-col :span="3">
          <el-button type="primary" @click="handleAddxxx()"><i class="el-icon-plus" />数据下发</el-button>
        </el-col> -->
      </template>
      <template v-slot:handle="slotProps">
        <el-button type="primary" size="small" round @click.native.prevent="editHandle(slotProps.row)">报警详情</el-button>
      
        <el-button type="primary" style=" background-color: blue;" size="small" round @click.native.prevent="handleAdd(slotProps.row)">报警设置</el-button>
      
        <el-button type="primary" style=" background-color: blue;" size="small" round @click.native.prevent="handleAddGb(slotProps.row)">关闭响铃</el-button>
      </template>
    </wise-crud>  
    <el-dialog ref="drawer_zl" :title="title" :visible.sync="drawer_zl" destroy-on-close>
      <div v-if="drawer_zl" class="draw-body">
        <div class="wise-form">
          <el-form ref="ruleForm" :model="object" :rules="rules" :validate-on-rule-change="false" label-width="130px"
            label-suffix=":">
            <div class="zhiliang">
              <label >质量数值</label>
            <el-form-item label="焊接电流" style="width: 900px;">
                开启:<el-switch :disabled="Ddisabled" v-model="objX.K1001"></el-switch>
                <!-- 上限:<el-input-number  :disabled="Ddisabled" style="width: 130px;"  v-model="objX.S1001"></el-input-number>
                下限:<el-input-number  :disabled="Ddisabled" style="width: 130px;"  v-model="objX.X1001"></el-input-number> -->
            </el-form-item>
            <el-form-item label="焊接电压" style="width: 900px;">
                开启:<el-switch :disabled="Ddisabled" v-model="objX.K1002"></el-switch>
                <!-- 上限:<el-input-number :disabled="Ddisabled" style="width: 130px;"  v-model="objX.S1002"></el-input-number>
                下限:<el-input-number :disabled="Ddisabled" style="width: 130px;"  v-model="objX.X1002"></el-input-number> -->
            </el-form-item>
            <el-form-item label="焊接速度" style="width: 900px;">
                开启:<el-switch :disabled="Ddisabled" v-model="objX.K1003"></el-switch>
                上限:<el-input-number :disabled="Ddisabled" style="width: 130px;" v-model="objX.S1003"></el-input-number>
                下限:<el-input-number :disabled="Ddisabled" style="width: 130px;" v-model="objX.X1003"></el-input-number>
            </el-form-item>
            <el-form-item label="气 流 量" style="width: 900px;">
                开启:<el-switch :disabled="Ddisabled" v-model="objX.K1004"></el-switch>
                上限:<el-input-number :disabled="Ddisabled" style="width: 130px;" v-model="objX.S1004"></el-input-number>
                下限:<el-input-number :disabled="Ddisabled" style="width: 130px;" v-model="objX.X1004"></el-input-number>
            </el-form-item>
             
            <el-form-item label="热影响区温度" style="width: 900px;">
                开启:<el-switch :disabled="Ddisabled" v-model="objX.K1005"></el-switch>
                上限:<el-input-number :disabled="Ddisabled" style="width: 130px;" v-model="objX.S1005"></el-input-number>
                下限:<el-input-number :disabled="Ddisabled" style="width: 130px;" v-model="objX.X1005"></el-input-number>
            </el-form-item>
          </div>
        </el-form>
        </div>
      </div>
    </el-dialog>


    <el-dialog ref="drawer_aq" :title="title" :visible.sync="drawer_aq" destroy-on-close>
      <div v-if="drawer_aq" class="draw-body">
        <div class="wise-form">
          <el-form ref="ruleForm" :model="object" :rules="rules" :validate-on-rule-change="false" label-width="130px"  label-suffix=":">
          <div class="anquan">
            <label >安全数值</label>
            <el-form-item label="风速" style="width: 900px;">
                开启:<el-switch :disabled="Ddisabled" v-model="objX.K2001"></el-switch>
                上限:<el-input-number :disabled="Ddisabled" style="width: 130px;"  v-model="objX.S2001"></el-input-number>
                下限:<el-input-number :disabled="Ddisabled" style="width: 130px;"  v-model="objX.X2001"></el-input-number>
            </el-form-item>
            <el-form-item label="温度" style="width: 900px;">
                开启:<el-switch :disabled="Ddisabled" v-model="objX.K2002"></el-switch>
                上限:<el-input-number :disabled="Ddisabled" style="width: 130px;"  v-model="objX.S2002"></el-input-number>
                下限:<el-input-number :disabled="Ddisabled" style="width: 130px;"  v-model="objX.X2002"></el-input-number>
            </el-form-item>
            <el-form-item label="湿度" style="width: 900px;">
                开启:<el-switch :disabled="Ddisabled" v-model="objX.K2003"></el-switch>
                上限:<el-input-number :disabled="Ddisabled" style="width: 130px;" v-model="objX.S2003"></el-input-number>
                下限:<el-input-number  :disabled="Ddisabled" style="width: 130px;" v-model="objX.X2003"></el-input-number>
            </el-form-item>
            <el-form-item label="甲烷" style="width: 900px;">
                开启:<el-switch :disabled="Ddisabled" v-model="objX.K2004"></el-switch>
                上限:<el-input-number :disabled="Ddisabled" style="width: 130px;" v-model="objX.S2004"></el-input-number>
                下限:<el-input-number :disabled="Ddisabled" style="width: 130px;" v-model="objX.X2004"></el-input-number>
            </el-form-item>
             
            <el-form-item label="氧气" style="width: 900px;">
                开启:<el-switch :disabled="Ddisabled" v-model="objX.K2005"></el-switch>
                上限:<el-input-number :disabled="Ddisabled" style="width: 130px;" v-model="objX.S2005"></el-input-number>
                下限:<el-input-number :disabled="Ddisabled" style="width: 130px;" v-model="objX.X2005"></el-input-number>
            </el-form-item>
            <el-form-item label="一氧化碳" style="width: 900px;">
                开启:<el-switch :disabled="Ddisabled" v-model="objX.K2006"></el-switch>
                上限:<el-input-number :disabled="Ddisabled" style="width: 130px;" v-model="objX.S2006"></el-input-number>
                下限:<el-input-number :disabled="Ddisabled" style="width: 130px;" v-model="objX.X2006"></el-input-number>
            </el-form-item>
             
            <el-form-item label="硫化氢" style="width: 900px;">
                开启:<el-switch :disabled="Ddisabled" v-model="objX.K2007"></el-switch>
                上限:<el-input-number :disabled="Ddisabled" style="width: 130px;" v-model="objX.S2007"></el-input-number>
                下限:<el-input-number :disabled="Ddisabled" style="width: 130px;" v-model="objX.X2007"></el-input-number>
            </el-form-item>
          </div>
         
          </el-form>
        </div>
      </div>
    </el-dialog>


    <el-dialog ref="drawer1_zl" title="编辑报警" :visible.sync="drawer1_zl" destroy-on-close>
      <div v-if="drawer1_zl" class="draw-body">
        <div class="wise-form">
          <el-form ref="ruleForm" :model="object" :rules="rules" :validate-on-rule-change="false" label-width="130px"
            label-suffix=":">
            <div class="zhiliang">
              <label >质量数值</label>
            <el-form-item label="焊接电流" style="width: 900px;">
                开启:<el-switch  v-model="objX.K1001"></el-switch>
                <!-- 上限:<el-input-number   style="width: 130px;"  v-model="objX.S1001"></el-input-number>
                下限:<el-input-number   style="width: 130px;"  v-model="objX.X1001"></el-input-number> -->
            </el-form-item>
            <el-form-item label="焊接电压" style="width: 900px;">
                开启:<el-switch  v-model="objX.K1002"></el-switch>
                <!-- 上限:<el-input-number  style="width: 130px;"  v-model="objX.S1002"></el-input-number>
                下限:<el-input-number  style="width: 130px;"  v-model="objX.X1002"></el-input-number> -->
            </el-form-item>
            <el-form-item label="焊接速度" style="width: 900px;">
                开启:<el-switch  v-model="objX.K1003"></el-switch>
                上限:<el-input-number  style="width: 130px;" v-model="objX.S1003"></el-input-number>
                下限:<el-input-number  style="width: 130px;" v-model="objX.X1003"></el-input-number>
            </el-form-item>
            <el-form-item label="气 流 量" style="width: 900px;">
                开启:<el-switch  v-model="objX.K1004"></el-switch>
                上限:<el-input-number  style="width: 130px;" v-model="objX.S1004"></el-input-number>
                下限:<el-input-number  style="width: 130px;" v-model="objX.X1004"></el-input-number>
            </el-form-item>
             
            <el-form-item label="热影响区温度" style="width: 900px;">
                开启:<el-switch  v-model="objX.K1005"></el-switch>
                上限:<el-input-number  style="width: 130px;" v-model="objX.S1005"></el-input-number>
                下限:<el-input-number  style="width: 130px;" v-model="objX.X1005"></el-input-number>
            </el-form-item>
          </div>
          <el-form-item>
              <el-button type="primary" @click="submitForm('ruleForm')">提交</el-button>
              <el-button @click="resetForm('ruleForm')">重置</el-button>
            </el-form-item>
        </el-form>
        </div>
      </div>
    </el-dialog>
    <el-dialog ref="drawer1_aq" :title="title" :visible.sync="drawer1_aq" destroy-on-close>
      <div v-if="drawer1_aq" class="draw-body">
        <div class="wise-form">
          <el-form ref="ruleForm" :model="object" :rules="rules" :validate-on-rule-change="false" label-width="130px"
            label-suffix=":">
          <div class="anquan">
            <label >安全数值</label>
            <el-form-item label="风速" style="width: 900px;">
                开启:<el-switch  v-model="objX.K2001"></el-switch>
                上限:<el-input-number  style="width: 130px;"  v-model="objX.S2001"></el-input-number>
                下限:<el-input-number  style="width: 130px;"  v-model="objX.X2001"></el-input-number>
            </el-form-item>
            <el-form-item label="温度" style="width: 900px;">
                开启:<el-switch  v-model="objX.K2002"></el-switch>
                上限:<el-input-number  style="width: 130px;"  v-model="objX.S2002"></el-input-number>
                下限:<el-input-number  style="width: 130px;"  v-model="objX.X2002"></el-input-number>
            </el-form-item>
            <el-form-item label="湿度" style="width: 900px;">
                开启:<el-switch  v-model="objX.K2003"></el-switch>
                上限:<el-input-number  style="width: 130px;" v-model="objX.S2003"></el-input-number>
                下限:<el-input-number   style="width: 130px;" v-model="objX.X2003"></el-input-number>
            </el-form-item>
            <el-form-item label="甲烷" style="width: 900px;">
                开启:<el-switch  v-model="objX.K2004"></el-switch>
                上限:<el-input-number  style="width: 130px;" v-model="objX.S2004"></el-input-number>
                下限:<el-input-number  style="width: 130px;" v-model="objX.X2004"></el-input-number>
            </el-form-item>
             
            <el-form-item label="氧气" style="width: 900px;">
                开启:<el-switch  v-model="objX.K2005"></el-switch>
                上限:<el-input-number  style="width: 130px;" v-model="objX.S2005"></el-input-number>
                下限:<el-input-number  style="width: 130px;" v-model="objX.X2005"></el-input-number>
            </el-form-item>
            <el-form-item label="一氧化碳" style="width: 900px;">
                开启:<el-switch  v-model="objX.K2006"></el-switch>
                上限:<el-input-number  style="width: 130px;" v-model="objX.S2006"></el-input-number>
                下限:<el-input-number  style="width: 130px;" v-model="objX.X2006"></el-input-number>
            </el-form-item>
             
            <el-form-item label="硫化氢" style="width: 900px;">
                开启:<el-switch  v-model="objX.K2007"></el-switch>
                上限:<el-input-number  style="width: 130px;" v-model="objX.S2007"></el-input-number>
                下限:<el-input-number  style="width: 130px;" v-model="objX.X2007"></el-input-number>
            </el-form-item>
          </div>
            <el-form-item>
              <el-button type="primary" @click="submitForm('ruleForm')">提交</el-button>
              <el-button @click="resetForm('ruleForm')">重置</el-button>
            </el-form-item>
          </el-form>
        </div>
      </div>
    </el-dialog>
  </div>
</template>
<script>
  import WiseCrud from '@/components/Crud/wiseCrud'
  import dayjs from 'dayjs'
  import {
    postHandle
  } from '@/api'
  export default {
    name: 'GatewayEquipmentManage',
    components: {
      WiseCrud
    },
    data() {
      return {
        t: dayjs().format('HHmmss'),
        day: dayjs().format('YYYYMMDD'),
    
        drawer1_zl:false,
        drawer1_aq:false,
        multipleSelection:[],
        Ddisabled:true,
        gatewayCodex:[],
        obj:[],
       gatewayCode:"",
        objX: {

        
        K1001:false,
        K1002:false,
        K1003:false,
        K1004:false,
        K1005:false,

        K2001:false,
        K2002:false,
        K2003:false,
        K2004:false,
        K2005:false,
        K2006:false,
        K2007:false,


        S1001:0,
        S1002:0,
        S1003:0,
        S1004:0,
        S1005:0,

        S2001:5,
        S2002:100,
        S2003:90,
        S2004:20,
        S2005:50,
        S2006:50,
        S2007:20,

        X1001:0,
        X1002:0,
        X1003:0,
        X1004:0,
        X1005:0,

        X2001:0,
        X2002:5,
        X2003:0,
        X2004:0,
        X2005:19.5,
        X2006:0,
        X2007:0,
      },
        urls: {
          list: '/api/v1/welder-sbtx-second/gateway-equipment-comb/list1',
          add: '/api/v1/welder-sbtx-second/alarm-info-comb/creatAlarmInfo',
          show: '/api/v1/welder-sbtx-second/gateway-equipment-comb/show/',
          update: '/api/v1/welder-sbtx-second/alarm-info-comb/creatAlarmInfo',
          delete: '/api/v1/welder-sbtx-second/gateway-equipment-comb/remove/'
        },
        handle: [''],
        fields: [{
            label: '序号',
            type: 'index',
            use: ['table']
          },
          // {
          //   label: '所属项目',
          //   prop: 'projectInfo',
          //   type: 'select',
          //   labelWidth: '130px',
          //   url: '/api/v1/welder-sbtx-second/project-info',
          //   labelKey: 'name',
          //   valueKey: 'id',
          //   objKeys: [
          //     {
          //       field: 'projectId',
          //       key: 'id'
          //     }
          //   ],
          //   rules: [
          //     { required: true, message: '请选择项目', trigger: 'change' }
          //   ],
          //   placeholder: '请选择项目',
          //   use: ['filters']
          // },
          // {
          //   label: '所属项目',
          //   prop: 'manage',
          //   type: 'render',
          //   labelWidth: '130px',
          //   tableRender: (h, row, index) => {
          //     return h('div', row.projectInfo ? row.projectInfo.name : '')
          //   },
          //   viewRender: (h, item, object) => {
          //     return h('div', object.projectInfo ? object.projectInfo.name : '')
          //   },
          //   use: ['table', 'view']
          // },
          {
            label: '网关编号',
            prop: 'gatewayCode',
            type: 'render',
            labelWidth: '130px',
            tableRender: (h, row, index) => {
              return h('div', row.gateway ? row.gateway.gatewayCode : '')
            },
            viewRender: (h, item, object) => {
              return h('div', object.gateway ? object.gateway.gatewayCode : '')
            },
            use: ['table', 'view', 'search']
          },
          // {
          //   label: '网关类型',
          //   prop: 'gatewayType',
          //   type: 'radio',
          //   dataDic: 'gatewayType',
          //   labelWidth: '130px',
          //   use: ['table', 'view', 'search']
          // },
          {
            label: '所属设备',
            prop: 'manage',
            type: 'render',
            labelWidth: '130px',
            tableRender: (h, row, index) => {
              return h(
                'div',
                row.hjEquipmentInfo ? row.hjEquipmentInfo.name : ''
              )
            },
            viewRender: (h, item, object) => {
              return h(
                'div',
                object.hjEquipmentInfo ? object.hjEquipmentInfo.name : ''
              )
            },
            use: ['table', 'view']
          },
          
          {
            label: '操作',
            type: 'handle',
            use: ['table'],
            handle: [ ],
            tableWidth: 300
          }
        ],
        drawer_aq:false,
        drawer_zl:false,
        title: '新增',
        projectList: [],
        gatewayList: [],
        hjEquipmentList: [],
        object: {
          gatewayId: null,
          gatewayType: null,
          showStates: null,
          projectId: null,
          hjEqId: null
        },
        hjEqId: null,
        gatewayTypeList: require('@/components/Crud/data/dataDictionary')
          .gatewayType,
        rules: {
          projectId: [{
            required: true,
            message: '请选择项目',
            trigger: 'blur'
          }],
          gatewayId: [{
            required: true,
            message: '请选择网关编号',
            trigger: 'blur'
          }]
        }
      }
     
    },
    computed: {
      entSpaceId() {
        return this.$store.getters.entSpaceId
      },
      filters() {
        return [{
          field: 'entSpaceId',
          operator: 'EQUALS',
          value: this.$store.getters.entSpaceId
        }]
      }
    },
    methods: {

      //所属设备切换
      changeHjEq(val) {
        this.hjEqId = val
        let hjeqIndex = this.hjEquipmentList.findIndex(item => val == item.id)
        this.object.gatewayType = this.hjEquipmentList[hjeqIndex].typeCode
      },
      handleSelectionChange(val) {
       
        
        this.multipleSelection = val
        this.gatewayCodex=this.multipleSelection.map((item) => item.gateway.gatewayCode)
      },
      handleAdd(row) {
        this.gatewayCode= row.gateway.gatewayCode
        var gatewayCodeq=row.gateway.gatewayCode
          var gc=gatewayCodeq.substring(8,9);
         
          if(gc=="9"){
             this.drawer1_aq=true;
          }else if(gc=="8"){
            //切断设备
            this.$message('暂无切断设备预警！')
          }else{
            this.drawer1_zl=true;
          }
        postHandle('/api/v1/welder-sbtx-second/alarm-info-comb/alarmInfo', {
          gatewayCode: row.gateway.gatewayCode}
       ).then((response) => {
        this.objX = response.result
        
      })

         
      
       
       
        // this.remoteMethod2()
        // this.getHjEquipmentList()
        // this.object = {
        //   gatewayId: null,
        //   gatewayType: null,
        //   showStates: null,
        //   projectId: null,
        //   hjEqId: null,
        //   entSpaceId: this.entSpaceId
        // }
     
       
      },handleAddGb(row) {
          this.gatewayCode= row.gateway.gatewayCode
          let dd=this.day.substring(2,this.day.length);
          let msg = '7e7e'+this.gatewayCode+dd+this.t+'4600020000';
        
          postHandle('/api/v1/welder-sbtx-second/welds-operation-record-comb/send-device-data', {
            obj: {
              message: msg,
              gatewayCode: this.gatewayCode
            }
          }).then(res => {
            this.$message.success('数据下发成功')
          })
        
       
      }, handleAddxxx() {
        if(!( this.multipleSelection&&  this.multipleSelection.length>0)) {
          this.$message.error('请选择要设置的网关')
          return false
        }
        this.gatewayCodex=this.multipleSelection.map((item) => item.gateway.gatewayCode)
        for(let ww in this.gatewayCodex)  {
          let msg = '7e7e'+ww+'230703131401460002ffff';
          postHandle('/api/v1/welder-sbtx-second/welds-operation-record-comb/send-device-data', {
            obj: {
              message: msg,
              gatewayCode: ww
            }
          }).then(res => {
            this.$message.success('数据下发成功')
          })
        }
    },
      async editHandle(row) {
          var gatewayCode=row.gateway.gatewayCode
          var gc=gatewayCode.substring(8,9);
        
          if(gc=="9"){
             this.drawer_aq=true;
          }else if(gc=="8"){
            //切断设备
            this.$message('暂无切断设备预警！')
          }else{
            this.drawer_zl=true;
          }
       
        
          postHandle('/api/v1/welder-sbtx-second/alarm-info-comb/alarmInfo', {
            gatewayCode: row.gateway.gatewayCode}
         ).then((response) => {
            this.objX = response.result
            
          })

         
        await this.remoteMethod2()
        await this.getHjEquipmentList()
        this.title = '详情'
        this.getObjectById(row.id)
       
      },
      
       
      updateStatus(obj) {
        postHandle(this.urls.update + obj.id, {
          d: {},
          obj
        }).then((response) => {
          this.object = response.result
          
        })
      },
      getObjectById(id) {
        postHandle(this.urls.show + id, {}).then((response) => {
          this.object = response.result
          let data = response.result
          if (this.gatewayList.findIndex(item => item.id == data.gateway.id) === -1) {
            this.gatewayList.push({
              id: data.gateway.id,
              gatewayCode: data.gateway.gatewayCode,
              disabled: true
            })
          }
          if (this.hjEquipmentList.findIndex(item => item.id == data.hjEquipmentInfo.id) === -1) {
            this.hjEquipmentList.push({
              id: data.hjEqId,
              name: data.hjEquipmentInfo.name,
              disabled: true
            })
          }

          // this.object.gatewayId = data.gateway.id
          // this.object.hjEqId = data.hjEqId
          // this.object = data
          // for (let key in data) {
          //   this.object[key] = data[key]
          // }
          // this.object.projectName = this.object.projectInfo.name
          // this.remoteMethod2(this.object.projectId)
        })
      },
      // selectInfo2(value) {
      //   this.object.gatewayId = null
      //   if (value) {
      //     this.projectList.find(item => item.id === value)
      //     this.remoteMethod2(value)
      //   } else {
      //     this.gatewayList = []
      //   }
      // },
      // remoteMethod(query) {
      //   let params = {
      //     d: {
      //       page: {
      //         ps: 9999,
      //         p: 1
      //       },
      //       retPage: false
      //     }
      //   }
      //   postHandle('/api/v1/welder-sbtx-second/project-info', params).then(res => {
      //     this.loading = false
      //     this.projectList = res.result
      //   })
      // },
      async remoteMethod2() {
        let params = {
          d: {
            filters: [{
              field: 'entSpaceId',
              operator: 'EQUALS',
              value: this.entSpaceId
            }],
            page: {
              ps: 9999,
              p: 1
            },
            retPage: false
          },
          obj: {
            noClass: true
          }
        }
        this.loading = true
        await postHandle('/api/v1/welder-sbtx-second/gateway-comb/list', params).then(
          (res) => {
            // postHandle('/api/v1/welder-sbtx-second/gateway-equipment-comb/create', params).then(res => {
            this.loading = false
            this.gatewayList = res.result
          }
        )
      },
      submitForm(formName) {
        this.$refs[formName].validate((valid) => {
          
            let url
           
              url = this.urls.update 
             
             // this.gatewayCodex=this.multipleSelection.map((item) => item.gateway.gatewayCode)
             

            postHandle(url, {
              aix: this.objX,gatewayCode1:this.gatewayCode
              })
              .then((response) => {
                if(response.result){
                  this.$message('操作成功')
                }else{
                  this.$message('操作失败')
                }
                var gc=this.gatewayCode.substring(8,9);
                
                if(gc=="9"){
                  this.drawer1_aq=false;
                }else if(gc=="8"){
                  //切断设备
                  this.$message('暂无切断设备预警！')
                }else{
                  this.drawer1_zl=false;
                }
             
                
                if (this.object.id) {
                  this.$refs['wise-crud'].handleSearch(0)
                } else {
                  this.$refs['wise-crud'].handleSearch(1)
                }
              })
              .catch((error) => {
                const data = error.response.data
                for (const key in data) {
                  this.$message.error(this.$t(key + '.' + data[key]))
                }
              })
           
        })
      },
      resetForm(formName) {
        this.$refs[formName].resetFields()
          // postHandle('/api/v1/welder-sbtx-second/alarm-info-comb/alarmInfo', {
          //     gatewayCode: this.gatewayCode}
          // ).then((response) => {
             // this.objX = response.result
              this.objX= {

        
              K1001:false,
              K1002:false,
              K1003:false,
              K1004:false,
              K1005:false,

              K2001:false,
              K2002:false,
              K2003:false,
              K2004:false,
              K2005:false,
              K2006:false,
              K2007:false,


              S1001:0,
              S1002:0,
              S1003:0,
              S1004:0,
              S1005:0,

              X1001:0,
              X1002:0,
              X1003:0,
              X1004:0,
              X1005:0,




              S2001:5,
              S2002:100,
              S2003:90,
              S2004:20,
              S2005:50,
              S2006:50,
              S2007:20,

              X2001:0,
              X2002:5,
              X2003:0,
              X2004:0,
              X2005:19.5,
              X2006:0,
              X2007:0,
              }
          // })
      },
      async getHjEquipmentList() {
        let params = {
          d: {
            filters: [{
              field: 'entSpaceId',
              operator: 'EQUALS',
              value: this.entSpaceId
            }],
            page: {
              ps: 9999,
              p: 1
            },
            retPage: false
          },
          obj: {
            noClass: true
          }
        }
        this.loading = true
        await postHandle(
          '/api/v1/welder-sbtx-second/hj-equipment-info-comb/list',
          params
        ).then((res) => {
          this.loading = false
          this.hjEquipmentList = res.result
        })
      }
    }
  }
</script>

<style>
  .zhiliang{
    border:1px solid rosybrown;
  }
  .anquan{
    margin-top: 30px;
    border:1px solid rosybrown;
  }
</style>